﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Project
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void lb_dataemp_Click(object sender, EventArgs e)
        {
            Response.Redirect("Master/Checkdata_Emp.aspx");
        }

        protected void lb_goodsorder_Click(object sender, EventArgs e)
        {
            Response.Redirect("Master/Goods_Order.aspx");
        }

        protected void lb_goodspay_Click(object sender, EventArgs e)
        {
            Response.Redirect("Master/Pay_Goods.aspx");
        }

        protected void lb_borrowgoods_Click(object sender, EventArgs e)
        {
            Response.Redirect("Master/Borrow_Goods.aspx");
        }

        protected void lb_sentgoods_Click(object sender, EventArgs e)
        {
            Response.Redirect("Master/Sent_Goods.aspx");
        }

        protected void BtOK_Click(object sender, EventArgs e)
        {
            Login LoginCheck = new Login();
            string IDEmp = tb_IDEmpoyee.Text;
           try
            {
                //string Encryption = Encode.getMd5Hash(Password);
                DataTable User_Pass = LoginCheck.GetData_Empoyee(IDEmp);

                if (User_Pass != null && User_Pass.Rows.Count > 0)
                {
                    //Userdata = User_Pass.Rows[0]["ID_card"].ToString();
                    // Session["Number"] = User_Pass.Rows[0]["NumBer"].ToString();
                    Session["IDEmp"] = User_Pass.Rows[0]["Employee_ID"].ToString();
                    Response.Redirect("Master/Checktime.aspx");
                    

                }
                else
                {
                  
                   Response.Write(@"<script language='javascript'>alert('ไม่พบข้อมูล!!!')</script>");
                }
            }
            catch (Exception)
            {
                Response.Write(@"<script language='javascript'>alert('ไม่พบข้อมูล!!!')</script>");
               
            }//Catch

           
           
        }

       
    }
}
